{if $goods}
<?php
$this->_var['gcss'][] = $this->_var['TMPL_REAL']."/css/jqzoom.css";
$this->_var['gjs'][] = $this->_var['TMPL_REAL']."/js/jquery.jqzoom.js";
$this->_var['gjs'][] = $this->_var['TMPL_REAL']."/js/jquery.scroll.js";
$this->_var['gjs'][] = $this->_var['TMPL_REAL']."/js/goods_info.js";
$this->_var['cgjs'][] = $this->_var['TMPL_REAL']."/js/goods_info.js";
?>
<link rel="stylesheet" type="text/css" href="{function name="parse_css" v="$gcss"}" />
<script type="text/javascript" src="{function name="parse_script" v="$gjs" c="$cgjs"}"></script>
<script type="text/javascript">
	var price_unit = "{function name="app_conf" value="CURRENCY_UNIT"}";
	{insert name="get_goods_attr_stock_json" id=$goods.id}
	var comment_url = '{url x="shop" r="comment" p="id=$goods.id"}';
	$(document).ready(function(){		
		$(".goods_main_pic").find("a").jqzoom();			
	});	
</script>

<div class="inc">
	<div class="inc_top">{function name="msubstr" v=$page_title b=0 e=20}</div>
	<div class="inc_main cf">
		<div class="goods_pic_box f_l">
					<div  class="goods_main_pic">
					<ul>
						{foreach from=$goods.image_list key=key item=image}
						<li class="{if $key eq 0}act {/if}pic_{$key}" rel="{$key}">
						<a href="{$image.origin_img}" target="_blank" title="{$goods.name}"><img src="{function name="get_spec_image" v=$image.img w="325" h="325"}"></a>
						</li>
						{/foreach}								
					</ul>
					</div>		
					<div class="blank"></div>
					{if $goods.image_list}
					<div class="goods_icon_pic">
					<a href="#" class="prev" onfocus="this.blur();">&nbsp;</a>					
					
					<div class="roll_pic">					
					<ul>
								{foreach from=$goods.image_list key=key item=image}
								<li {if $key eq 0}class="act"{/if} rel="{$key}">
								<img src="{function name="get_spec_image" v=$image.img w="46" h="46"}">
								</li>
								{/foreach}								
					</ul>					
					</div>
					
					<a href="#" class="next" onfocus="this.blur();">&nbsp;</a>
					</div>
					{/if}
		</div><!--end goods_pic_box-->
		<div class="goods_info_box f_r">
			<div class="goods_info_list">
			<ul>
			<li class="goods_name">{$goods.name} {if $goods.is_lottery eq 1} <span class="is_lottery"></span>{/if}</li>
			{if $goods.brand_info}
			<li>{$LANG.BRAND}：<a href="{url x="shop" r="brand" p="id=$goods.brand_info.id"}" title="{$goods.brand_info.name}">{$goods.brand_info.name}</a></li>
			{/if}
			<li>
				<span class="m_price">{$LANG.ORIGIN_PRICE}：{function name="format_price" v=$goods.origin_price}</span>
				<span class="s_price">{$LANG.CURRENT_PRICE}：{function name="format_price" v=$goods.current_price}<span id="attr_price"></span></span>
				<input type="hidden" name="current_price" value="{$goods.current_price}" />
			</li>
			
			<li {if $goods.deal_attr_list or $goods.max_bought eq 0}style="display:none;"{/if} id="stock">库存：<span>{insert name="get_goods_stock" id=$goods.id}</span> <input type="hidden" name="origin_stock" value="{$goods.max_bought}" /></li>
			<li>
				<a href="{url x="shop" r="goods" p="id=$goods.id&type=comment&is_buy=1"}#detail_box" title="{$LANG.VIEW_COMMENT}" id="view_comment">
				{insert name="load_goods_comment_tip" goods_id=$goods.id}
				</a>				
			</li>
			{if $goods.return_money gt 0 or $goods.return_score gt 0}
			<li>
				
					 会员特惠：
					 <span class="song">{if $goods.return_money gt 0}<b class="song_b"><em class="song_em">{function name="round" value="$goods.return_money" a=2}元现金</em></b>&nbsp;&nbsp;&nbsp;&nbsp;{/if}{if $goods.return_score gt 0}<b class="song_b"><em class="song_em">{$goods.return_score}积分 </em></b>{/if}
						<div class="song_zhush">
							购买付款成功后{if $goods.return_money gt 0}，{function name="round" value="$goods.return_money" a=2}元现金直接返还到您的账户上{/if}{if $goods.return_score gt 0}，积分累加{$goods.return_score}{/if}。
						</div>
					 </span>
					
			</li>
			{/if}
			</ul>
			<div class="goods_pick_box">
			<dl>
			{if $goods.deal_attr_list}
			{foreach from=$goods.deal_attr_list item=attr key=key}
			<dd>
			<span>{$attr.name}</span>： 
			<select name="attr[]">
				<option value="0">{$LANG.PLEASE_SELECT}{$attr.name}</option>
				{foreach from=$attr.attrs item=attr_item}
					<option value="{$attr_item.id}" rel="{$attr_item.name}" price="{$attr_item.price}">{$attr_item.name}{if $attr_item.price neq 0}+{function name="format_price" value=$attr_item.price}{/if}</option>
				{/foreach}
			</select>
			</dd>
			{/foreach}
			<dd>
				<span id="select_attr">{$LANG.PLEASE_SELECT} {foreach from=$goods.deal_attr_list item=attr key=key} [ {$attr.name} ] {/foreach}</span>
			</dd>
			{/if}
			<dd>
				{$LANG.BUY_NUMBER}：<input type="text" name="number" maxlength="4" id="buy_number" />
			</dd>
			<dd>
				<input type="hidden" value="{$goods.id}" name="goods_id" />
				{insert name="load_goods_time_status"}
			</dd>
			</dl>
			</div>
			
			<div class="goods_brief">
				{$goods.brief}
				</div>
			</div>
		</div>
		<div class="blank"></div>
		<div class="goods_detail_box" id="detail_box">
			<ul class="detail_nav">
				<li rel="1" {insert name='load_goods_tab' param=1}>{$LANG.GOODS_DETAIL}</li>
				<li rel="2" {insert name='load_goods_tab' param=2}>{$LANG.GOODS_COMMENT}</li>
			</ul>
			<div class="blank"></div>
			<ul class="detail_cnt">
				<li id="detail_cnt_1" {insert name='load_goods_tab' param=1}><div  class="lazy">{$goods.description}</div></li>
				<li id="detail_cnt_2" {insert name='load_goods_tab' param=2}>
					<div class="goods_comment_cnt">
						{insert name='load_goods_comment'} {* 动态团购点评 *}
					</div>					
				</li>
			</ul>
			
		</div><!--end goods_detail_box-->
	</div>
	<div class="inc_foot"></div>
</div>
{else}
{$LANG.NO_GOODS}
{/if}
